package org.wmq.javafxmapcollectioncs.service.impl;

import org.wmq.javafxmapcollectioncs.mapper.CommentMapper;
import org.wmq.javafxmapcollectioncs.mapper.impl.CommentMapperImplByHttpAndMysql;
import org.wmq.javafxmapcollectioncs.service.CommentService;

import java.io.IOException;

public class CommentServiceImpl implements CommentService {
    private final CommentMapper commentMapper = new CommentMapperImplByHttpAndMysql();
    @Override
    public String getById(Long id) {
        return this.commentMapper.selectById(id);
    }

    @Override
    public void add(Long id, String comment) throws IOException {
        this.commentMapper.insert(id,comment);
    }

    @Override
    public void update(Long id, String comment) {
        this.commentMapper.update(id,comment);
    }

    @Override
    public void deleteById(Long id) {
        this.commentMapper.deleteById(id);
    }

}
